cmake_minimum_required(VERSION 3.20)

project(libeventdemo LANGUAGES CXX)

if(MSVC)
	add_compile_options("/utf-8")
endif()

# 要求编译器支持 C++17（会选用编译器对应的开关：/std:c++17、-std=c++17 等）
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)   # 强制必须满足
set(CMAKE_CXX_EXTENSIONS OFF)         # 禁用编译器扩展（可选）

set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/build/lib")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/build/bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_SOURCE_DIR}/build/bin")

add_subdirectory("libevent")
add_subdirectory("demo")